package com.csun.dsms.controller.process;

import com.csun.dsms.comment.core.utils.wrapper.Wrapper;
import com.csun.dsms.model.process.DepartmentInfo;
import com.csun.dsms.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("/addDepartmentInfo")
    public Wrapper<Object> addDepartmentInfo(@RequestBody DepartmentInfo departmentInfo) {
        return  departmentService.addDepartmentInfo(departmentInfo);
    }

    @RequestMapping("/updateDepartmentInfo")
    public Wrapper<Object> updateDepartmentInfo(@RequestBody DepartmentInfo departmentInfo) {
        return  departmentService.updateDepartmentInfo(departmentInfo);
    }

    @RequestMapping("/deleteDepartmentInfo")
    public Wrapper<Object> deleteDepartmentInfo(@RequestBody DepartmentInfo departmentInfo) {
        return  departmentService.deleteDepartmentInfo(departmentInfo);
    }

    @RequestMapping("/getDepartmentInfoList")
    public Wrapper<Object> getDepartmentInfoList(@RequestBody DepartmentInfo departmentInfo) {
        return  departmentService.getDepartmentInfoList(departmentInfo);
    }

    @RequestMapping("/getAllDepartment")
    public Wrapper<Object> getAllDepartment() {
        return  departmentService.getAllDepartment();
    }
}
